/**************************** (C) COPYRIGHT 2018 Fortiortech shenzhen *****************************
* File Name          : PIInit.c
* Author             : Bruce,Fortiortech  RD
* Version            : V1.0
* Date               : 2018-07-01
* Description        : This file contains PI initial function used for Motor Control.
***************************************************************************************************
* All Rights Reserved
**************************************************************************************************/

#include "PIInit.h"
#include "FU68xx_4_MCU.h"
#include "Customer.h"
#include "Parameter.h"

void PI_Init(void)
{
    PI3_KP  = SKP;
    PI3_KI  = SKI;
    PI3_UKH = 0;
    PI3_UKL = 0;
    PI3_EK  = 0;
    PI3_EK1 = 0;
    PI3_KD = SKD;
    PI3_EK2 = 0;
    PI3_UKMAX = SOUTMAX;
    PI3_UKMIN = SOUTMIN;
    SetBit(PI_CR , PI3STA);          // Start PI
    while (ReadBit(PI_CR , PIBSY));
}
